//引入路由器
import {createRouter, createWebHistory} from 'vue-router'
//引入可能要呈现组件
import Home from '@/pages/Home.vue'
import About from '@/pages/About.vue'
import News from '@/pages/News.vue'
import Detail from '@/pages/Detail.vue'
//创建路由器
const router = createRouter({
    history:createWebHistory(), //工作模式
    routes:[ //路由规则
        {name:'zhuye',
         path:'/home',
         component:Home
        },
        {name:'guanyu',
         path:'/about',
         component:About
        },
        {name:'xinwen',
         path:'/news',
         component:News,
        children:[
            {
                name:'xiang',
                path:'detail/:id/:title/:content',   //子集不用写斜杠
                component:Detail
            }
        ]
        }
    ]
})
//将路由暴露出去
export default router